package day_2023_7_to_10;

import java.util.ArrayList;
import java.util.List;

/**
 * @author haomin
 * @date 2023/08/15 23:53
 **/
public class Day_8_15 {
    class Solution {
        public List<Integer> grayCode(int n) {
            List<Integer> ans = new ArrayList<>();
            for(int i = 0; i < (1 << n); ++i){
                ans.add(i ^ (i>>1));
            }
            return ans;
        }
    }
}